﻿using System.Collections.Generic;
using Dapper.Contrib.Extensions;
using Tk.Soc.Share.Common.Helpers;

namespace pinduoduo.Model
{
    [Table("pdd_order")]
    public class Order
    {


        [ExplicitKey]
        [AttrForCsvColumnLabel(Title = "订单号")]
        public string orderSn { get; set; }

        public string uid { get; set; }
        public string token { get; set; }
        public string goodsId { get; set; }
        [AttrForCsvColumnLabel(Title = "店铺")]
        public string mallName { get; set; }
        [AttrForCsvColumnLabel(Title = "产品")]
        public string goodsName { get; set; }
        [AttrForCsvColumnLabel(Title = "价钱")]
        public string goodsMoney { get; set; }
        [AttrForCsvColumnLabel(Title = "数量")]
        public string skuNumber { get; set; }
        [AttrForCsvColumnLabel(Title = "下单时间")]
        public string buyTime { get; set; }
        [AttrForCsvColumnLabel(Title = "订单状态")]
        public string orderState { get; set; }
        public string orderAddr { get; set; }
        [AttrForCsvColumnLabel(Title = "快递公司")]
        public string logisticsCompany { get; set; }
        [AttrForCsvColumnLabel(Title = "快递单号")]
        public string logisticsOrderNo { get; set; }

        [AttrForCsvColumnLabel(Title = "物流信息")]
        public string logisticsInfo { get; set; }

        [AttrForCsvColumnLabel(Title = "姓名")]
        public string name { get; set; }

        [AttrForCsvColumnLabel(Title = "电话")]
        public string mobile { get; set; }

        [AttrForCsvColumnLabel(Title = "收货地址")]
        public string address { get; set; }

      

        [AttrForCsvColumnLabel(Title = "SKU")]
        public string skuName { get; set; }
        public string pay_url { get; set; }
        public string parent_order_sn { get; set; }
        public string address_id { get; set; }

        [AttrForCsvColumnLabel(Title = "订单类型")]
        public string order_type { get; set; }

        [AttrForCsvColumnLabel(Title = "物流最后更新时间")]
        public string last_update_time_logistics { get; set; }

        [Write(false)]
        public bool IsCheck { get; set; }

        public override bool Equals(object obj)
        {
            return obj is Order order &&
                   orderSn == order.orderSn;
        }

        public override int GetHashCode()
        {
            return 473171126 + EqualityComparer<string>.Default.GetHashCode(orderSn);
        }
    }
}
